package com.sina.shop.service.foot;

import com.sina.shop.domain.foot.Foot;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description: 调用服务，并配置断路器，当调用出错时调用默认的配置。
 * 段浩杰   2018-01-31-17:40
 */
@FeignClient(value = "SHOP-SPRING-CLOUD-ALL", fallback = FootServiceBack.class)
public interface FootService {

    @RequestMapping(value = "/foot/updateFoot", method = RequestMethod.POST)
    Foot updateFoot(@RequestBody(required = false) Foot foot);

    @RequestMapping(value = "/foot/getFootByAdminId", method = RequestMethod.GET)
    List<Foot> getFootByAdminId(@RequestParam("adminId") Long adminId);

    @RequestMapping(value = "/foot/saveFoot", method = RequestMethod.POST)
    Foot saveFoot(@RequestBody(required = false) Foot foot);

    @RequestMapping(value = "/foot/deleteFoot", method = RequestMethod.POST)
    Integer deleteFoot(@RequestParam("id") Long id);


}
